{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "# Covariance and Correlation"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "Covariance measures how two variables vary in tandem from their means.\n",
    "\n",
    "For example, let's say we work for an e-commerce company, and they are interested in finding a correlation between page speed (how fast each web page renders for a customer) and how much a customer spends.\n",
    "\n",
    "numpy offers covariance methods, but we'll do it the \"hard way\" to show what happens under the hood. Basically we treat each variable as a vector of deviations from the mean, and compute the \"dot product\" of both vectors. Geometrically this can be thought of as the angle between the two vectors in a high-dimensional space, but you can just think of it as a measure of similarity between the two variables.\n",
    "\n",
    "First, let's just make page speed and purchase amount totally random and independent of each other; a very small covariance will result as there is no real correlation:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-0.019528192170968867"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnX+UHNV157+3e0qiR/aqR/ZERxojhAlHJFiWxkyIYsU+\nFsRobbCZBRvZB3LYrE/YP7w5FmEnFg5rkJcclKO1IX/tLmsnhxyIMzI/BrFkLRzAmwQv2CNmZFkG\nhWBL4EYgxdIIo2lJrZ67f3RXT3X1e69e/eiu6p77OQdG09Nddavr1X333Xd/EDNDEARB6H5yaQsg\nCIIgJIModEEQhB5BFLogCEKPIApdEAShRxCFLgiC0COIQhcEQegRRKELgiD0CKLQBUEQegRR6IIg\nCD1CXydP9t73vpdXr17dyVMKgiB0PXv37v1XZh4Mel9HFfrq1asxOTnZyVMKgiB0PUR02OZ94nIR\nBEHoEUShC4Ig9A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m9zHz\natSemWeY+aaUxYoMES2pb7qj7pq4CkDXusOY+U0ArxOR2xn9SgAdCyRIracoM58jov8EYA9qm1R/\nycwH0pInLkT0bQAfA/BeIvoFgDuZ+VvpShWLjQB+H8D+uu8ZAL7CzH+XokxRWQHgASLKoWbEPMjM\n30tZJqHGcgCP1ewH9AH4G2b+broixeaPADxUN1R/BuAPOnViyRQVBEHoEWRTVBAEoUcQhS4IgtAj\niEIXBEHoEUShC4Ig9Aii0AVBEHoEUeiCIAg9gih0QRCEHkEUuiAIQo/w/wG4YxKWmp4JOwAAAABJ\nRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1306baf1f98>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "\n",
    "import numpy as np\n",
    "from pylab import *\n",
    "\n",
    "def de_mean(x):\n",
    "    xmean = mean(x)\n",
    "    return [xi - xmean for xi in x]\n",
    "\n",
    "def covariance(x, y):\n",
    "    n = len(x)\n",
    "    return dot(de_mean(x), de_mean(y)) / (n-1)\n",
    "\n",
    "pageSpeeds = np.random.normal(3.0, 1.0, 1000)\n",
    "purchaseAmount = np.random.normal(50.0, 10.0, 1000)\n",
    "\n",
    "scatter(pageSpeeds, purchaseAmount)\n",
    "\n",
    "covariance (pageSpeeds, purchaseAmount)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "Now we'll make our fabricated purchase amounts an actual function of page speed, making a very real correlation. The negative value indicates an inverse relationship; pages that render in less time result in more money spent:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-8.8565771898786672"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB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PAwxTLur3oKHA0Ikqffr9FMfjn\nRLcGvWeo6lLZxcu7gOcj4iudbk+rJA1I6s8eFyh2ANjf2VbNTERsi4gVEbGK4t/M9yPiEx1u1oxJ\nWpxd8Ccrc/wh0JNltYh4DTgiaU226MPAnHVg6Njk4LWkNkOVpPuADwIXSjoKfCEi7upsq2bsCuCT\nwIGsrg3wuWyimV60DNghqY/iic89EfFoh9tkRUuBh4vnFiwAvhkR/9TZJrXkU8C92cnrz4E/n6s3\n7srulWZm1j7dWroxM7M2cdCbmSXOQW9mljgHvZlZ4hz0ZmaJc9CbmSXOQW9mljgHvZlZ4v4/WKWJ\nBOCwsvsAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1306baf12e8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "purchaseAmount = np.random.normal(50.0, 10.0, 1000) / pageSpeeds\n",
    "\n",
    "scatter(pageSpeeds, purchaseAmount)\n",
    "\n",
    "covariance (pageSpeeds, purchaseAmount)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "But, what does this value mean? Covariance is sensitive to the units used in the variables, which makes it difficult to interpret. Correlation normalizes everything by their standard deviations, giving you an easier to understand value that ranges from -1 (for a perfect inverse correlation) to 1 (for a perfect positive correlation):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-0.62897824783314804"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def correlation(x, y):\n",
    "    stddevx = x.std()\n",
    "    stddevy = y.std()\n",
    "    return covariance(x,y) / stddevx / stddevy  #In real life you'd check for divide by zero here\n",
    "\n",
    "correlation(pageSpeeds, purchaseAmount)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "numpy can do all this for you with numpy.corrcoef. It returns a matrix of the correlation coefficients between every combination of the arrays passed in:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 1.        , -0.62834927],\n",
       "       [-0.62834927,  1.        ]])"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.corrcoef(pageSpeeds, purchaseAmount)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "(It doesn't match exactly just due to the math precision available on a computer.)\n",
    "\n",
    "We can force a perfect correlation by fabricating a totally linear relationship (again, it's not exactly -1 just due to precision errors, but it's close enough to tell us there's a really good correlation here):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-1.0010010010010009"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHp9JREFUeJzt3X2QleWZ5/HvzwaShjWDxpaSVhZGWRNHTPfa5UuIliZB\nEZzkhNoKuprKZLIwVWuyQWtNmpAd4wyMnTEv/DGzyfq2ZQqiZKMyyeAgOOZlQgLaDi2ggoAi0hro\nKWREJALNtX/0c0zbnqb7PE93n7ffp8rqPs957nOuo3gu7vu6XxQRmJmZnVTqAMzMrDw4IZiZGeCE\nYGZmCScEMzMDnBDMzCzhhGBmZoATgpmZJZwQzMwMcEIwM7PEqIFukHQfcC2wLyLOT66dCqwAJgO7\ngM9GxOvJcwuBLwLdwP+IiMcKvGa/7U/ktNNOi8mTJw/8q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hFjzeTh6OB\nOuD1EoaUiaQzgdnAPaWOxd5N0h8BlwP3AkTEkZFKBlDZCaEReKXX4z1U6BdOtZM0GWgGNpQ2kvSS\nIZYOYB/wi4io5KG9pcBXgeOlDmSIBPC4pKclzS91MBlNAbqA/5sM6d0jadxIvXklJwSrAJL+A/AQ\nsCAi3ih1PGlFRHdENAFnApdJurLUMaUh6VpgX0Q8XepYhtDHkv821wA3JcOvlWoU8J+B70dEM3AI\nGLH6aCUnhE7grF6Pz0yuWZlIxtsfApZHxMOljmcoJN33VfSMv1ei6cCnknH3B4GPS1pW2pCyiYjO\n5Oc+4BF6hpMr1R5gT0Tke9M/oSdBjIhKTghPAVMlTUkKL9cBPy1xTJZICrH3As9HxHdLHU8Wkhok\njU9+r6dnIkNHaaNKJyIWRsSZETGZnv9nnoiIG0scVmqSxiWTFkiGVq4CKnY4LyJ+B7wi6dzk0ieA\nEZuIUbFnKkfEMUlfAh6jp8h3X0Q8W+KwUpP0AHAFcJqkPcBtEXFvaaPKZDrwOWBzMvYO8PWIeLSE\nMaV1BnC/pJPo+UvUsohYW+KYrMcE4JGev38wCvhRRKwubUiZfRlYnvxF90XgCyP1xhU77dTMzIZW\nJQ8ZmZnZEHJCMDMzwAnBzMwSTghmZgY4IZiZWcIJwczMACcEMzNLOCGYmRkA/x+vPNduTkgL6gAA\nAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1306d6c9cf8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "purchaseAmount = 100 - pageSpeeds * 3\n",
    "\n",
    "scatter(pageSpeeds, purchaseAmount)\n",
    "\n",
    "correlation (pageSpeeds, purchaseAmount)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "Remember, correlation does not imply causality!"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "## Activity"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "numpy also has a numpy.cov function that can compute Covariance for you. Try using it for the pageSpeeds and purchaseAmounts data above. Interpret its results, and compare it to the results from our own covariance function above."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
